Field of the Invention
The present invention relates to the allocation of data storage resources to data flows.
Description of the Related Art
There is a concept called a data flow focusing attention on the flow of data as a method of modeling (expressing) various algorithms (systems). The flow of data in an algorithm is called a data flow, and an operation of receiving data from a data flow, performing processing on the received data, and outputting the result of the processing to a data flow is called a process. The process performs processing when receiving data from a data flow on the input side, and outputs the result of the processing to a data flow on the output side. Processing advances while data is converted by processes along data flows. The data flow having this mechanism is often used in data driven type algorithm development.
There is a diagram called a data flow diagram (DFD) graphically describing data flows. An example is a data flow diagram as shown in FIG. 1A. Referring to FIG. 1A, external entity A (1001) is a camera, and a sensed image is input to process B (1002) along data flow ab (1101). Processes B (1002) to F (1006) sequentially perform processing along data flows, and finally output the processing result to external entity G (1007) which is a display. Each of external entities A (1001) and G (1007) exists outside a system to be modeled, and functions as a data input source or data output destination of the system.
When implementing an algorithm described by a DFD as computer software, each process is generated as an instance (object), and the generated processes are associated with each other by an object representing a data flow.
Data flowing through data flows are exchanged between processes via a data storage resource such as a memory or file associated with each data flow. That is, the process reads out input data from a data storage resource associated with an input-side data flow, and writes the processing result in a data storage resource associated with an output-side data flow.
As data processing techniques using a data flow, Cantata (see A Hands-on Guide to VisiQuest, AccuSoft Corporation) and DirectShow (see DirectX 9.0 Programmer's Reference, Microsoft Corporation) are known.
In Cantata, files are used as data storage resources, and an individual file is allocated to each data flow.
In DirectShow, no static data storage resource is associated with any data flow, and an allocator is associated with each data flow instead. A process issues a data storage resource acquisition request to an allocator when necessary (when outputting data), sets a value in the data storage resource, and transfers the data storage resource to a process as the destination of the data flow. When the processing is complete, if the process determines that the data storage resource is unnecessary, the process requests the allocator to collect the data storage resource. If the input and output allocators are the same, the process can transfer a data storage resource obtained from the input side directly to a process on the output stage, without acquiring any new data storage resource for output.
In Cantata, however, files equal in number to data flows exist. Therefore, many data storage resources unrelated to a process currently executing processing exist, so a file storage amount in a disk or the like is enormous. To increase the processing speed, therefore, it is possible to, for example, expand data storage resources on a memory. In this case, however, the memory amount required for the system becomes enormous.
In DirectShow, data storage resources are dynamically acquired and collected. This promotes the reuse of the data storage resources (that is, a plurality of data flows share the same data storage resource). This reduces the memory amount required for the programs. Since, however, data storage resource acquisition and collection requests are frequently performed for allocators, the calling cost and request processing cost are high. Generally, these calling and requesting processes interrupt the pipeline of a CPU, thereby causing a large decrease in processing speed in a system that processes a large amount of data.